import React, { Component } from 'react'
import '../index/index.scss'
import Axios from '../../utils/myAxios'

export default class Lead_list extends Component {
    state={
        showlist:[]
    }
    render() {
        return (
            
            <div className="products">
            {this.state.showlist.map((v) => {
              return (
                <div className="imgListItem" key={v.floor_title.image_src}>
                  {/* 标题 */}
                  <div className="item-title">
                    <img src={v.floor_title.image_src} alt="" />
                  </div>
                  {/* 内容 ,还需数组遍历,v.product_list是一个数组*/}
                  <div className="item-con">
                    {v.product_list.map((vv) => {
                      return (
                        <div className="item-con-single" key={vv.image_src}>
                          <img src={vv.image_src} alt="" />
                        </div>
                      );
                    })}
                  </div>
                </div>
              );
            })}
          </div>
              
           
                        
        )
    }
    componentDidMount(){
        Axios.get("home/floordata").then((res)=>{
            console.log(res);
            
            this.setState({
                showlist:res
            })
        })
    }
    
}
            